{include('Layout/header')}
<div class="row row-bgcolor">
    <div class='col-md-12 content-title'>
        <h3>管理评论</h3>
    </div>
    <div class='col-md-8 content col-md-offset-2'>
        <div class='select-border'>
            <form class="form-inline" action="{\Rexzy::url('admin/comment')}" method='post'>
                <div class="form-group">
                  <label class="sr-only" for="search"></label>
                  <input type="text" class="form-control input-sm" id="search" name='search' placeholder="请输入关键字">
                </div>
                <button type="submit" class="btn btn-default ulist-bt">搜索</button>
            </form>
        </div>
        <div class='table-list'>
            <table class="table table-hover">
                <colgroup>
                    <col width="5%">
                    <col width="30%">
                    <col width="65%">
                </colgroup>
                <thead>
                    <tr>
                        <th></th>
                        <th>作者</th>
                        <th>内容</th>
                    </tr>
                </thead>
                <tbody>
                    {if $total == 0}{/php}
                    <td colspan='3'><h6 class='list-none'>没有{$keyword}评论</h6></td>
                    {else}
                    {foreach $comments $key $val}
                    <tr><td><input type="checkbox" class='select-box' value="{$val['commentid']}" name="commentid"></td><td>
                            <div class="comment-author"><strong><a href="{$authorurl}{$val['name']}" target="_blank">{$val['name']}</a></strong></div>
                            <div class='comment-email'>{$val['email']}</div>
                        </td>
                        <td>
                            <div class='comment-meta'><span class='comment-date'>{$val['date']} 于</span> <a href="{$arturl}{$val['title']}.html#comment" target="_blank">{$val['title']}</a></div>
                            <div class='comment-content'>{$val['content']}</div>
                        </td>
                    </tr>
                    {/foreach}
                    {php}{/if}
                </tbody>
            </table>
        </div>
        <div class="paging-border">
            <div class='handle-user'>
                <label class="checkbox-inline">
                    <input type='checkbox' id='select_all' />选择全部
                </label>
                <button type="submit" id="comment_delete_btn">删除选中项</button>
                {if $returnHome == true}{/php}
                    <a href="{$url}" class="return-list">返回列表首页</a>
                {php}{/if}
            </div>
            <nav>
                <ul class="pagination">
                    {php}
                        $this->page->paging( $total, $rang = 5, $page, $length, $url, $condition );
                    {/php}
                </ul>
            </nav>
        </div>
    </div>
</div>

<script>
    $(function() {
        var warningMesg = "确定删除选中评论？";
        var handleUrl = url( 'admin/comdel');

        var goUrl = url( 'admin/comment' );
        deleteList( '#comment_delete_btn', warningMesg, handleUrl, goUrl )
    });
</script>
{include('Layout/footer')}